Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(keyboard): submit on enter keypress for checkboxes and radio buttons #741

Conversation

777PolarFox777
Copy link
Contributor

What:
Fix submit event on Enter keypress for checkboxes and radio as requested in issue #730

Why:
To match browser's behavior

How:
Add one more keypress plugin that matches checkboxes and radios in the form with the submit button/input

Checklist:

  • Documentation
  • Tests
  • Ready to be merged

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 11, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7679bcc:

Sandbox Source
userEvent-PR-template Configuration

@777PolarFox777 777PolarFox777 force-pushed the pr/fix-submit-keyboard-event-for-checkboxes-and-radio-buttons branch from eeb68ae to 09e1149 Compare October 11, 2021 19:03
@codecov
Copy link

codecov bot commented Oct 11, 2021

Codecov Report

Merging #741 (7679bcc) into main (9519979) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #741   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           50        51    +1     
  Lines          965       994   +29     
  Branches       389       413   +24     
=========================================
+ Hits           965       994   +29     
Impacted Files Coverage Δ
src/keyboard/plugins/functional.ts 100.00% <100.00%> (ø)
src/utils/misc/hasFormSubmit.ts 100.00% <100.00%> (ø)
src/tab.ts 100.00% <0.00%> (ø)
src/click.ts 100.00% <0.00%> (ø)
src/type/index.ts 100.00% <0.00%> (ø)
src/keyboard/index.ts 100.00% <0.00%> (ø)
src/select-options.ts 100.00% <0.00%> (ø)
src/keyboard/getNextKeyDef.ts 100.00% <0.00%> (ø)
src/keyboard/plugins/control.ts 100.00% <0.00%> (ø)
src/utils/edit/buildTimeValue.ts 100.00% <0.00%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9519979...7679bcc. Read the comment docs.

@ph-fritsche ph-fritsche linked an issue Oct 16, 2021 that may be closed by this pull request
@ph-fritsche ph-fritsche merged commit 97ba08e into testing-library:main Oct 18, 2021
@github-actions
Copy link

🎉 This PR is included in version 13.4.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ph-fritsche
Copy link
Member

@all-contributors add @777PolarFox777 code

@allcontributors
Copy link
Contributor

@ph-fritsche

I've put up a pull request to add @777PolarFox777! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

userEvent doesn't fire submit events for checkboxes
2 participants